package com.xmy.first;

// 枚举 enum
public class Demo2 {

    private enum Family {
        FATHER,
        MOTHER,
        SON,
        DAUGHTER;

    }
    public static void main(String[] args) {
        Family[] families = Family.values();
        for (Family f :
                families) {
            System.out.println(f.name() + "\'s ordinal is " + f.ordinal());
        }
    }
}
